home *** CD-ROM | disk | FTP | other *** search
/ The Programmer Disk / The Programmer Disk (Microforum).iso / xpro / qb2 / pro16 / wdi.bas < prev   
BASIC Source File  |  1992-02-06  |  2KB  |  67 lines

  1. ' WDI.Bas
  2. ' Portions Copyright 1987-1990 Microsoft Corp.
  3. WindowDoInit:
  4.  
  5.     ' ====================================================================
  6.     ' Simply abort if there is no window open.
  7.     ' ====================================================================
  8.  
  9.     windo = WindowCurrent
  10.     IF windo = 0 THEN EXIT SUB
  11.  
  12.     REDIM HSClick(MAXHOTSPOT) AS hotSpotType
  13.     REDIM HSRel(MAXHOTSPOT) AS hotSpotType
  14.  
  15.     ExitFlag = FALSE
  16.     ButtonHighLight = FALSE
  17.  
  18.     border$ = WindowBorder$(GloWindow(windo).windowType)
  19.     WindowDoMode = 2
  20.  
  21.     ' ====================================================================
  22.     ' If startEdit>0, assign the index value to currEditField, and set
  23.     ' WindowDoMode to 1
  24.     ' ====================================================================
  25.  
  26.     IF startEdit > 0 THEN
  27.       index = FindEditField(startEdit)
  28.       IF index > 0 THEN
  29.         currEditField = index
  30.         WindowDoMode = 1
  31.         origCursorRow = GloWindow(windo).row1 + GloEdit(index).row - 1
  32.         origCursorCol = GloWindow(windo).col1 + GloEdit(index).col - 1
  33.       END IF
  34.     END IF
  35.  
  36.     ' ====================================================================
  37.     ' If start button>0, then set current cursor location properly
  38.     ' ====================================================================
  39.  
  40.     IF startButton > 0 THEN
  41.       index = FindButton(startButton)
  42.       IF index > 0 THEN
  43.         currButton = index
  44.         origCursorRow = GloWindow(windo).row1 _
  45.                        + GloButton(index).row1 - 1
  46.         origCursorCol = GloWindow(windo).col1 + GloButton(index).col1
  47.  
  48.         ' ============================================================
  49.         ' For area buttons decrement the cursor position
  50.         ' ============================================================
  51.  
  52.         SELECT CASE GloButton(index).buttonType
  53.             CASE 4
  54.                 origCursorCol = origCursorCol - 1
  55.             CASE 5
  56.                 origCursorRow = origCursorRow + 1
  57.                 origCursorCol = origCursorCol + 1
  58.             CASE ELSE
  59.         END SELECT
  60.  
  61.       END IF
  62.     END IF
  63.  
  64.     currCursorRow = origCursorRow
  65.     currCursorCol = origCursorCol
  66. RETURN
  67.